package com.qfedu.mall.api.controller;

import com.qfedu.mall.beans.vo.SpellGroupVO;
import com.qfedu.mall.common.vo.ResultVO;
import com.qfedu.mall.service.SpellGroupService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@CrossOrigin
@Api(value = "提供收货拼团相关接口",tags = "拼团管理")
@RequestMapping("/pink")
public class SpellGroupController {
    @Autowired
    private SpellGroupService spellGroupService;

    @PostMapping(value = "/kaituan")
    @ApiOperation("开团")
    @ApiImplicitParam(dataType = "SpellGroupVO",name = "spellGroupVO",value = "开团详情",required = true)
    public ResultVO insertkai(@RequestBody SpellGroupVO spellGroupVO) {
        ResultVO resultVO = spellGroupService.insertByUser1(spellGroupVO);
        return resultVO;
    }
    @PostMapping(value = "/cantuan")
    @ApiOperation("参团")
    @ApiImplicitParam(dataType = "SpellGroupVO",name = "spellGroupVO",value = "参团详情",required = true)
    public ResultVO updatecan(@RequestBody SpellGroupVO spellGroupVO) {
        ResultVO resultVO = spellGroupService.updateByUser2(spellGroupVO);
        return resultVO;
    }
}
